<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>添加点击事件</title>
		<script type="text/javascript" src="../js/angular.min.js" ></script>
	</head>
	<body ng-app="myapp" ng-controller="myctrl">
		<table width="100%" border="1px">
			<tr>
				<td>id</td>
				<td>编号</td>
				<td>名称</td>
				<td>价格</td>
			</tr>
			<tr ng-repeat="product in products">
				<td>{{$index+1}}</td>
				<td>{{product.id}}</td>
				<td>{{product.name}}</td>
				<td>{{product.price}}</td>
			</tr>
			<script type="text/javascript">
				//初始化模块
				var app = angular.module("myapp",[]);
				app.controller("myctrl",["$scope",function($scope){
					$scope.products=[
						{
							id:1001,
							name:"电视机",
							price:998
						},
						{
							id:1002,
							name:"电脑",
							price:4998
						}
					]
				}]);
				
			</script>
		</table>
	</body>
</html>
